<template>
        <div class="nav-cart-wrapper">
              <div class="nav-cart-list">
                <div class="empty" v-if="vuexdata.length==0">
                  <h3>购物车为空</h3>
                  <p>您还没有选购任何商品，现在前往商城选购吧!</p>
                </div>
                <div class="full" v-else>
                  <div class="nav-cart-items">
                    <ul>
                      <li class="clear" v-for="(item,index) in vuexdata" :key="index" >
                        <div class="cart-item js-cart-item cart-item-sell">
                          <div class="cart-item-inner">
                            <div class="item-thumb">
                              <img :src="item.image" />
                            </div>
                            <div class="item-desc">
                              <div class="cart-cell">
                                <h4>
                                  <a href="#/item/100027401">{{item.title}}</a>
                                </h4>
                                <p class="attrs">
                                  <span>{{item.detail.color_name}}</span>
                                </p>
                                <h6>
                                  <span class="price-icon">¥</span>
                                  <span class="price-num">{{item.price}}</span>
                                  <span class="item-num">x {{item.snum}}</span>
                                </h6>
                              </div>
                            </div>
                            <div class="del-btn" @click="datadel(index)">删除</div>
                          </div>
                        </div>
                      </li>
                    </ul>
                  </div>
                  <div class="nav-cart-total">
                    <p>
                      共
                      <strong class="ng-binding">{{alldata.allnum}}</strong> 件商品
                    </p>
                    <h5>
                      合计：
                      <span class="price-icon">¥</span>
                      <span class="price-num ng-binding" ng-bind="cartMenu.totalPrice">{{alldata.allprice}}</span>
                    </h5>
                    <h6>
                      <a
                        @click="JumpCart"
                        class="nav-cart-btn"
                        href="javascript:;"
                      >去购物车</a>
                    </h6>
                  </div>
                </div>
              </div>
            </div>
</template>

<script>
export default {
  computed: {
      vuexdata(){
        return this.$store.state.record
      },
      alldata(){
        return this.$store.getters.alldata
      },
     
  },
  methods: {
     datadel(i){
         this.$store.commit('recorddel',i)
      },
      JumpCart(){
        this.$router.push({
              path:'/cart'
          })
      }
  },
}
</script>

<style>

</style>